{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "f79f6419-a262-4d73-8b07-d100a61db72f",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "import os\n",
    "from pathlib import Path\n",
    "import json"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "7be63af4-28bb-4a1a-9a6e-6e7146fbad5e",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "## CONSTANTS\n",
    "DATA_DIR = '/red/ruogu.fang/UKB/data/Brain'\n",
    "T1_FILE_PATH = '20252_T1_NIFTI'\n",
    "T2_FILE_PATH = '20253_T2_NIFTI'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "744496af-1727-414c-b9b0-0178a89fc388",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "data_path = Path(DATA_DIR)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "c7202dc8-f381-4505-afaf-be5b41b97d95",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "def split_id_from_file(filename: str) -> str: \n",
    "    '''Split patient ID from a filename. Note that this function\n",
    "    does not take into account the visit number, nor number of s\n",
    "    '''\n",
    "    return filename.split('_')[0]  # First section is id."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "ac13908b-e064-4b21-98db-cf78f311c6d9",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "def ids_to_json(ids: set, outdir: os.PathLike, \n",
    "                name='GatorBrain_matched_subjects.json') -> None:\n",
    "    outdir = Path(outdir)\n",
    "    with open(outdir / name, 'w') as json_file:\n",
    "        json.dump(list(ids), json_file)\n",
    "    print(f'Saved matching subject IDs to {outdir / name}')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "45e46d92-f54f-48ff-9992-0b5d2212c1db",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "t1_path = data_path / T1_FILE_PATH\n",
    "t2_path = data_path / T2_FILE_PATH / 'T2_unzip'\n",
    "\n",
    "# T1 data is stored in two different areas\n",
    "new_t1_path = t1_path / 'T1_new_unzip'\n",
    "old_t1_path = t1_path / 'T1_unzip'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "e57c9964-9b9c-4a9d-a910-989438d5e42c",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "old_t1_ids = [split_id_from_file(filename.name) \n",
    "              for filename in old_t1_path.iterdir()]\n",
    "\n",
    "new_t1_ids = [split_id_from_file(filename.name) \n",
    "              for filename in new_t1_path.iterdir()]\n",
    "\n",
    "t1_ids = set(old_t1_ids).union(set(new_t1_ids))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "7ca45828-870e-4656-a7ea-3342d348b594",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "t2_ids = [split_id_from_file(filename.name)\n",
    "          for filename in t2_path.iterdir()]\n",
    "t2_ids = set(t2_ids)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "d64a61d3-6419-4183-a932-4a4e2c034af3",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "matching_ids = t1_ids.intersection(t2_ids)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "28d4436e-dce1-4c12-89bb-5df91f94d26f",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Total of 44172 unique T1 subjects\n",
      "Total of 43369 unique T2 subjects\n",
      "Total of 43367 matching subjects found\n",
      "Saved matching subject IDs to GatorBrain_matched_subjects.json\n"
     ]
    }
   ],
   "source": [
    "print(f'Total of {len(t1_ids)} unique T1 subjects')\n",
    "print(f'Total of {len(t2_ids)} unique T2 subjects')\n",
    "print(f'Total of {len(matching_ids)} matching subjects found')\n",
    "ids_to_json(matching_ids, outdir='.')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "d3ff2fa3-97bf-4844-b823-205a72094edb",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "datalist = list(matching_ids)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 104,
   "id": "6ba7f60a-7d01-4cb8-86c2-043b22782c7a",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/red/ruogu.fang/UKB/data/Brain/20252_T1_NIFTI/T1_unzip\n",
      "/red/ruogu.fang/UKB/data/Brain/20252_T1_NIFTI/T1_new_unzip\n"
     ]
    }
   ],
   "source": [
    "print(old_t1_path)\n",
    "print(new_t1_path)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "edbc940d-6a50-4995-8026-a88e7ba52236",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/red/ruogu.fang/UKB/data/Brain/20252_T1_NIFTI/T1_unzip\n",
      "/red/ruogu.fang/UKB/data/Brain/20252_T1_NIFTI/T1_new_unzip\n"
     ]
    }
   ],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4f50f980-1893-4073-811f-c944affad4b4",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "train_datalist=[]\n",
    "for subject in datalist[:-2000]:\n",
    "    old_image_t1 = str(old_t1_path) + '/' + subject + \"_20252_2_0/T1_brain_to_MNI.nii.gz\"\n",
    "    new_image_t1 = str(new_t1_path) + '/' + subject + \"_20252_2_0/T1/T1_brain_to_MNI.nii.gz\"\n",
    "    if os.path.exists(old_image_t1):\n",
    "        train_datalist.append({\"image\":old_image_t1}) \n",
    "    elif os.path.exists(new_image_t1):\n",
    "        train_datalist.append({\"image\":new_image_t1}) \n",
    "    else:\n",
    "        print(f\"subject:{subject} T1 not found\")\n",
    "    \n",
    "    \n",
    "    image_t2 = str(t2_path) + '/' + subject + \"_20253_2_0/T2_FLAIR/T2_FLAIR_brain_to_MNI.nii.gz\"\n",
    "    \n",
    "    if os.path.exists(image_t2):\n",
    "        train_datalist.append({\"image\":image_t2})\n",
    "    else:\n",
    "        print(f\"subject:{subject} T2 not found\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 106,
   "id": "5bae1fd0-d5e3-4e57-ab60-d262e70af2c8",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "79599"
      ]
     },
     "execution_count": 106,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(train_datalist)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 111,
   "id": "7972ea02-7bcb-4deb-af24-9f1054f12818",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "subject:4351722 T1 not found\n",
      "subject:4351722 T2 not found\n",
      "subject:1908048 T2 not found\n",
      "subject:1557943 T1 not found\n",
      "subject:5928357 T1 not found\n",
      "subject:5928357 T2 not found\n",
      "subject:3769383 T2 not found\n",
      "subject:4552556 T2 not found\n",
      "subject:4689269 T1 not found\n",
      "subject:4689269 T2 not found\n",
      "subject:2132060 T2 not found\n",
      "subject:2870212 T1 not found\n",
      "subject:2870212 T2 not found\n",
      "subject:3317194 T1 not found\n",
      "subject:3317194 T2 not found\n",
      "subject:5521801 T2 not found\n",
      "subject:2280469 T1 not found\n",
      "subject:2280469 T2 not found\n",
      "subject:4985859 T1 not found\n",
      "subject:4985859 T2 not found\n",
      "subject:1949762 T1 not found\n",
      "subject:1949762 T2 not found\n",
      "subject:2686310 T1 not found\n",
      "subject:2686310 T2 not found\n",
      "subject:3618516 T2 not found\n",
      "subject:2174921 T1 not found\n",
      "subject:2174921 T2 not found\n",
      "subject:5082007 T1 not found\n",
      "subject:5082007 T2 not found\n",
      "subject:3257416 T1 not found\n",
      "subject:3257416 T2 not found\n",
      "subject:3559430 T2 not found\n",
      "subject:3646722 T1 not found\n",
      "subject:3646722 T2 not found\n",
      "subject:5666273 T1 not found\n",
      "subject:5666273 T2 not found\n",
      "subject:1616652 T2 not found\n",
      "subject:4897134 T1 not found\n",
      "subject:4897134 T2 not found\n",
      "subject:1575891 T1 not found\n",
      "subject:1575891 T2 not found\n",
      "subject:5462335 T2 not found\n",
      "subject:2523317 T1 not found\n",
      "subject:2523317 T2 not found\n",
      "subject:5983319 T2 not found\n",
      "subject:1593796 T1 not found\n",
      "subject:1593796 T2 not found\n",
      "subject:4692730 T1 not found\n",
      "subject:4692730 T2 not found\n",
      "subject:1269099 T1 not found\n",
      "subject:1269099 T2 not found\n",
      "subject:2772892 T1 not found\n",
      "subject:2772892 T2 not found\n",
      "subject:3577015 T1 not found\n",
      "subject:3577015 T2 not found\n",
      "subject:3399015 T1 not found\n",
      "subject:3399015 T2 not found\n",
      "subject:5530001 T1 not found\n",
      "subject:5530001 T2 not found\n",
      "subject:1990758 T2 not found\n",
      "subject:2528680 T1 not found\n",
      "subject:2528680 T2 not found\n",
      "subject:4981825 T1 not found\n",
      "subject:4981825 T2 not found\n",
      "subject:5119360 T2 not found\n",
      "subject:2531191 T2 not found\n",
      "subject:1420074 T1 not found\n",
      "subject:1420074 T2 not found\n",
      "subject:1566270 T1 not found\n",
      "subject:1566270 T2 not found\n",
      "subject:2944440 T1 not found\n",
      "subject:2944440 T2 not found\n",
      "subject:4752760 T1 not found\n",
      "subject:4752760 T2 not found\n",
      "subject:4032374 T1 not found\n",
      "subject:4032374 T2 not found\n",
      "subject:5289116 T1 not found\n",
      "subject:5289116 T2 not found\n",
      "subject:1462691 T2 not found\n",
      "subject:4605406 T1 not found\n",
      "subject:4605406 T2 not found\n",
      "subject:4858270 T2 not found\n",
      "subject:3061393 T1 not found\n",
      "subject:3061393 T2 not found\n",
      "subject:4224330 T1 not found\n",
      "subject:4224330 T2 not found\n",
      "subject:3817681 T1 not found\n",
      "subject:3817681 T2 not found\n",
      "subject:3312847 T2 not found\n",
      "subject:5595053 T1 not found\n",
      "subject:5595053 T2 not found\n",
      "subject:3790923 T1 not found\n",
      "subject:3790923 T2 not found\n",
      "subject:1555567 T1 not found\n",
      "subject:3203045 T1 not found\n",
      "subject:3203045 T2 not found\n",
      "subject:5846514 T1 not found\n",
      "subject:5846514 T2 not found\n",
      "subject:1560080 T1 not found\n",
      "subject:2107793 T1 not found\n",
      "subject:2107793 T2 not found\n",
      "subject:1752430 T1 not found\n",
      "subject:1752430 T2 not found\n",
      "subject:2110291 T2 not found\n",
      "subject:5185981 T1 not found\n",
      "subject:5185981 T2 not found\n",
      "subject:1450665 T1 not found\n",
      "subject:1450665 T2 not found\n",
      "subject:3584418 T2 not found\n",
      "subject:4050967 T1 not found\n",
      "subject:4050967 T2 not found\n",
      "subject:2915312 T2 not found\n",
      "subject:3950006 T1 not found\n",
      "subject:3950006 T2 not found\n",
      "subject:1526678 T1 not found\n",
      "subject:1526678 T2 not found\n",
      "subject:2334717 T1 not found\n",
      "subject:2334717 T2 not found\n",
      "subject:2626068 T1 not found\n",
      "subject:2626068 T2 not found\n",
      "subject:3200076 T2 not found\n",
      "subject:5609260 T1 not found\n",
      "subject:5609260 T2 not found\n",
      "subject:1177741 T1 not found\n",
      "subject:1177741 T2 not found\n",
      "subject:2128207 T1 not found\n",
      "subject:2128207 T2 not found\n",
      "subject:1760833 T2 not found\n",
      "subject:1956515 T1 not found\n",
      "subject:1956515 T2 not found\n",
      "subject:5623079 T2 not found\n",
      "subject:2180132 T1 not found\n",
      "subject:2180132 T2 not found\n",
      "subject:5329479 T2 not found\n",
      "subject:5104763 T1 not found\n",
      "subject:5104763 T2 not found\n",
      "subject:2088932 T1 not found\n",
      "subject:2088932 T2 not found\n",
      "subject:5990183 T1 not found\n",
      "subject:5990183 T2 not found\n",
      "subject:3008667 T1 not found\n",
      "subject:3008667 T2 not found\n",
      "subject:3295143 T2 not found\n",
      "subject:3719857 T1 not found\n",
      "subject:3719857 T2 not found\n",
      "subject:4193895 T2 not found\n",
      "subject:1754951 T1 not found\n",
      "subject:1754951 T2 not found\n",
      "subject:3619383 T1 not found\n",
      "subject:3619383 T2 not found\n",
      "subject:1735241 T2 not found\n",
      "subject:1726138 T1 not found\n",
      "subject:1726138 T2 not found\n",
      "subject:5276659 T2 not found\n",
      "subject:1912222 T1 not found\n",
      "subject:1912222 T2 not found\n",
      "subject:2539509 T1 not found\n",
      "subject:2539509 T2 not found\n",
      "subject:3511883 T2 not found\n"
     ]
    }
   ],
   "source": [
    "val_datalist=[]\n",
    "for subject in datalist[-2000:]:\n",
    "    old_image_t1 = str(old_t1_path) + '/' + subject + \"_20252_2_0/T1_brain_to_MNI.nii.gz\"\n",
    "    new_image_t1 = str(new_t1_path) + '/' + subject + \"_20252_2_0/T1/T1_brain_to_MNI.nii.gz\"\n",
    "    if os.path.exists(old_image_t1):\n",
    "        val_datalist.append({\"image\":old_image_t1}) \n",
    "    elif os.path.exists(new_image_t1):\n",
    "        val_datalist.append({\"image\":new_image_t1}) \n",
    "    else:\n",
    "        print(f\"subject:{subject} T1 not found\")\n",
    "    \n",
    "    image_t2 = str(t2_path) + '/' + subject + \"_20253_2_0/T2_FLAIR/T2_FLAIR_brain_to_MNI.nii.gz\"\n",
    "    if os.path.exists(image_t2):\n",
    "        val_datalist.append({\"image\":image_t2})\n",
    "    else:\n",
    "        print(f\"subject:{subject} T2 not found\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 112,
   "id": "5dfc6edb-b406-4367-8861-1cfe8347e670",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3841"
      ]
     },
     "execution_count": 112,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(val_datalist)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 113,
   "id": "4bcbd34c-80fd-429e-a41e-1330869d700e",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "data = {\"training\":train_datalist,\n",
    "        \"validation\":val_datalist}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "id": "bf1e98f1-b921-4065-aef6-d73c2b871a37",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "83465"
      ]
     },
     "execution_count": 114,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(data[\"training\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 115,
   "id": "640578c3-b6f8-45cc-9461-e91a141b0d1a",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3841"
      ]
     },
     "execution_count": 115,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(data[\"validation\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8227a10e-e3a1-4ba1-868d-90c4b8a6ac3d",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "data[\"validation\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 117,
   "id": "86eac6e9-4420-4e0f-b9a7-b1254cc7bdb4",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "with open(\"GBR_T1_T2_matched.json\", 'w') as json_file:\n",
    "    json.dump(data, json_file)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "0ce74704-8e10-4f3d-8767-eea71be2c484",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "def load_T1T2mixed_datalist(args, input_file: str):\n",
    "    with open(input_file, 'r') as f:\n",
    "        fold = json.load(f)\n",
    "    print(fold.keys())\n",
    "    training_images = fold['training'] # Should be list\n",
    "    validation_images = fold['validation']\n",
    "    t1_path = args['t1_path'] #'/red/ruogu.fang/UKB/data/Brain/20252_T1_NIFTI/T1_unzip'\n",
    "    t2_path = args['t2_path'] #'/red/ruogu.fang/UKB/data/Brain/20253_T2_NIFTI/T2_unzip'\n",
    "    training = {}\n",
    "    for i, image in enumerate(training_images):\n",
    "        image_t1 = t1_path + '/' + image + \"_20252_2_0/T1_brain_to_MNI.nii.gz\"\n",
    "        image_t2 = t2_path + '/' + image + \"_20253_2_0/T2_FLAIR/T2_FLAIR_brain_to_MNI.nii.gz\"\n",
    "        training[i] = {\"T1_image\": image_t1,\n",
    "                       \"T2_image\": image_t2}\n",
    "\n",
    "    validation = {}\n",
    "    for i, image in enumerate(validation_images):\n",
    "        image_t1 = t1_path + '/' + image + \"_20252_2_0/T1_brain_to_MNI.nii.gz\"\n",
    "        image_t2 = t2_path + '/' + image + \"_20253_2_0/T2_FLAIR/T2_FLAIR_brain_to_MNI.nii.gz\"\n",
    "        validation[i] = {\"T1_image\": image_t1,\n",
    "                         \"T2_image\": image_t2}\n",
    "    return {'training': training,\n",
    "            'validation': validation}\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "02f5d808-584b-409e-8206-98a545b9d3d7",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "dict_keys(['training', 'validation'])\n"
     ]
    }
   ],
   "source": [
    "args={\n",
    "    't1_path':'/red/ruogu.fang/UKB/data/Brain/20252_T1_NIFTI/T1_unzip',\n",
    "    't2_path':'/red/ruogu.fang/UKB/data/Brain/20253_T2_NIFTI/T2_unzip'\n",
    "    }\n",
    "input_file=\"GBR_T1_T2_matched.json\"\n",
    "data = load_T1T2mixed_datalist(args, input_file)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "8ad5494c-6a9a-49c8-bc7e-07bb78761880",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "data['training']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "020a5496-2098-4d85-8605-7cb272aec540",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "data['validation']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "id": "bec2e0c7-0261-484b-85f6-9812c483ae97",
   "metadata": {},
   "outputs": [],
   "source": [
    "def load_T1T2mixed_datalist(args, input_file: str):\n",
    "    with open(input_file, 'r') as f:\n",
    "        fold = json.load(f)\n",
    "    print(fold.keys())\n",
    "    training_images = fold['training'] # Should be list\n",
    "    validation_images = fold['validation']\n",
    "    #training = {}\n",
    "    #for i, image in enumerate(training_images):\n",
    "    #    training[i] = image # here is pair\n",
    "    #training[i] = image # here is pair\n",
    "    training = {i: image for i, image in enumerate(training_images)}\n",
    "    #validation = {}\n",
    "    #for i, image in enumerate(validation_images):\n",
    "    #    validation[i] = image \n",
    "    validation = {i: image for i, image in enumerate(validation_images)}\n",
    "    return {'training': training,\n",
    "            'validation': validation}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "id": "136f97f1-2f1b-49ad-9493-c11a7cd182bb",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "dict_keys(['training', 'validation'])\n"
     ]
    }
   ],
   "source": [
    "args={\n",
    "    't1_path':'/red/ruogu.fang/UKB/data/Brain/20252_T1_NIFTI/T1_unzip',\n",
    "    't2_path':'/red/ruogu.fang/UKB/data/Brain/20253_T2_NIFTI/T2_unzip'\n",
    "    }\n",
    "input_file=\"GBR_T1_T2_matched.json\"\n",
    "data = load_T1T2mixed_datalist(args, input_file)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "id": "89168a52-183d-492f-927c-8ac1574e4a2f",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "82734"
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(data['training'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "id": "1391ed6f-0f35-4549-b8cf-6f332aeb8dbd",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4000"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(data['validation'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "db9b87ba-1319-4d84-8e9c-19d26406c9c9",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "data['validation']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2fbe148d-3701-4fb4-afdd-cc54da895da9",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "torch timm",
   "language": "python",
   "name": "torch_timm"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.16"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
